package com.jh.fcsm.beans.sys;

import com.jh.fcsm.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * 文件表
 *
 * @author szx
 * @date 2020-07-07 08:32:18
 */
@Table(name = "SYS_FILE_INFO")
@ApiModel(value = "com.jh.fcsm.beans.sys.SysFileInfo", description = "文件表")
public class SysFileInfo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Column(name = "NAME")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "文件名")
    private String name;

    @Column(name = "ISIMG")
    @ColumnType(jdbcType = JdbcType.INTEGER)
    @ApiModelProperty(value = "是否是图片1是0否")
    private Integer isimg;

    @Column(name = "CONTENT_TYPE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "文件类型")
    private String contentType;

    @Column(name = "SIZE")
    @ColumnType(jdbcType = JdbcType.INTEGER)
    @ApiModelProperty(value = "文件大小")
    private Long size;

    @Column(name = "PATH")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "物理路径")
    private String path;

    @Column(name = "URL")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "文件网络url")
    private String url;

    @Column(name = "SOURCE")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "文件存储地方")
    private String source;


    @Column(name = "MD5")
    @ColumnType(jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "md5")
    private String md5;


    private boolean thumbnail = false;
    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }
    public boolean isThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(boolean thumbnail) {
        this.thumbnail = thumbnail;
    }

    /**
     * GET 文件名
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * SET 文件名
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * GET 是否是图片1是0否
     *
     * @return isimg
     */
    public Integer getIsimg() {
        return isimg;
    }

    /**
     * SET 是否是图片1是0否
     *
     * @param isimg
     */
    public void setIsimg(Integer isimg) {
        this.isimg = isimg;
    }

    /**
     * GET 文件类型
     *
     * @return contentType
     */
    public String getContentType() {
        return contentType;
    }

    /**
     * SET 文件类型
     *
     * @param contentType
     */
    public void setContentType(String contentType) {
        this.contentType = contentType == null ? null : contentType.trim();
    }

    /**
     * GET 文件大小
     *
     * @return size
     */
    public Long getSize() {
        return size;
    }

    /**
     * SET 文件大小
     *
     * @param size
     */
    public void setSize(Long size) {
        this.size = size;
    }

    /**
     * GET 物理路径
     *
     * @return path
     */
    public String getPath() {
        return path;
    }

    /**
     * SET 物理路径
     *
     * @param path
     */
    public void setPath(String path) {
        this.path = path == null ? null : path.trim();
    }

    /**
     * GET 文件网络url
     *
     * @return url
     */
    public String getUrl() {
        return url;
    }

    /**
     * SET 文件网络url
     *
     * @param url
     */
    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }

    /**
     * GET 文件存储地方
     *
     * @return source
     */
    public String getSource() {
        return source;
    }

    /**
     * SET 文件存储地方
     *
     * @param source
     */
    public void setSource(String source) {
        this.source = source == null ? null : source.trim();
    }



    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}